// dllmain.cpp : Defines the entry point for the DLL application.

#ifdef _MSC_VER
#include "../lib/stdafx.h"
#else
#include <windef.h>
#endif

BOOL APIENTRY DllMain(HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved) {
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH: 

#ifdef _DEBUG
		_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF);
		break;
#endif
		
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:	break;
	case DLL_PROCESS_DETACH:	

#ifdef _DEBUG
	OutputDebugString(L"=================================\n"\
					  L"hello.dll is about to dump leaks.\n");		
	_CrtDumpMemoryLeaks();
	OutputDebugString(L"hello.dll is done with leak dumping.\n"\
					  L"====================================\n");		
#endif

		break;
	}
	return TRUE;
}

